package practica1;

public class Funcion5 extends FuncionMultiVar{
	static final int m = 5;

	public Funcion5(double xMin, double xMax, double precision, int n) {
		super(xMin, xMax, precision, n);
		maximo = -186.7309;
	}

	public double calcAptitud(double[] f) {
		double x1 = f[0];
		double x2 = f[1];
		double izq = 0;
		double dcho = 0;
		for (int i=1; i<=m; i++) {
			izq += i * Math.cos((i+1)*x1 +i);
			dcho += i * Math.cos((i+1)*x2 +i);
		}
		return izq * dcho;
	}

}
